home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_005 / mandelbrotsrc / mand.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  6KB  |  224 lines

  1.  
  2. /*
  3.               MAND.H -- The Constants and Definitions
  4.              Mandelbrot Self-Squared Dragon Generator
  5.                     For the Commodore Amiga
  6.                          Version 2.01
  7.  
  8.                       Accompanies MAND.C
  9.  
  10.              Copyright (c) 1985, Robert S. French
  11.                   Placed in the Public Domain
  12.  
  13.               Vastly Enhanced by =RJ Mical=  1985
  14.  
  15. This program may be distributed free of charge as long as the above
  16. notice is retained.
  17.  
  18. */
  19.  
  20.  
  21. /*-------------------*/
  22. /* Lots of includes! */
  23.  
  24. #include <exec/types.h>
  25. #include <exec/tasks.h>
  26. #include <exec/libraries.h>
  27. #include <exec/devices.h>
  28. #include <devices/keymap.h>
  29. #include <graphics/copper.h>
  30. #include <graphics/display.h>
  31. #include <graphics/gfxbase.h>
  32. #include <graphics/text.h>
  33. #include <graphics/view.h>
  34. #include <graphics/gels.h>
  35. #include <graphics/regions.h>
  36. #include <hardware/blit.h>
  37. #include <intuition/intuition.h>
  38. #include <intuition/intuitionbase.h>
  39. #include <stdio.h>
  40.  
  41. #include <libraries/dos.h>
  42.  
  43. #include <workbench/workbench.h>
  44.  
  45. #include "iff.h"
  46.  
  47.  
  48. /*-------------------*/
  49. /* Misc. definitions */
  50. #define VERSION "2.01"
  51.  
  52. #define F_INTUITION 0x000001
  53. #define F_GRAPHICS  0x000002
  54. #define F_MATH      0x000004
  55. #define F_MATHTRANS 0x000008
  56. #define F_CONSOLE   0x000010
  57. #define F_COLORTAB  0x000020
  58. #define F_SETSTORE  0x000040
  59. #define F_ICON      0x000080
  60.  
  61.  
  62. #define EVER ;;
  63. #define MAXX 640
  64. #define MAXY 400
  65. #define MAXMY 100
  66. #define STARTY 0
  67. #define PROCESS_STACKSIZE 6000
  68.  
  69. /*---------------------------------*/
  70. /* Fast-Floating-Point Definitions */
  71.  
  72. extern   int     SPFix();
  73. extern   int     SPFlt();
  74. extern   int     SPCmp();
  75. extern   int     SPTst();
  76. extern   int     SPAbs();
  77. extern   int     SPNeg();
  78. extern   int     SPAdd();
  79. extern   int     SPSub();
  80. extern   int     SPMul();
  81. extern   int     SPDiv();
  82.  
  83. extern   int     SPAtan();
  84. extern   int     SPSin();
  85. extern   int     SPCos();
  86. extern   int     SPTan();
  87. extern   int     SPSincos();
  88. extern   int     SPSinh();
  89. extern   int     SPCosh();
  90. extern   int     SPTanh();
  91. extern   int     SPExp();
  92. extern   int     SPLog();
  93. extern   int     SPPow();
  94. extern   int     SPSqrt();
  95. extern   int     SPTieee();
  96. extern   int     SPFieee();
  97.  
  98.  
  99. #define TOPW2 w2->BorderTop
  100. #define BOTTOMW2 (w2->Height - w2->BorderBottom)
  101. #define LEFTW2 w2->BorderLeft
  102. #define RIGHTW2 (w2->Width - w2->BorderRight)
  103.  
  104.  
  105. /* === these definitions are for the color_mode variable ================== */
  106. #define NOT_HOLDANDMODIFY    0x0001
  107. #define INTERLACE_MODE        0x0002
  108. #define HIRES_MODE        0x0004
  109.  
  110. /* === these definitions are for the menu strips ========================== */#define ITEM_HEIGHT 10
  111. #define MENU_PROJECT 0    /* first menu */
  112. #define MENU_OPTIONS 1    /* next menu */
  113. #define MENU_ZOOM 2     /* next menu */
  114. #define MENU_COUNT 3
  115.  
  116. /* for the PROJECT Menu ... */
  117. #define PROJECT_WIDTH   176
  118. #define PROJECT_SAVEPICTURE 0
  119. #define PROJECT_COUNT        1
  120.  
  121. /* for the OPTIONS Menu ... */
  122. #define OPTIONS_WIDTH   176
  123. #define OPTIONS_LEFT       (-24)
  124. #define OPTIONS_QUARTER 0
  125. #define OPTIONS_FULL    1
  126. #define OPTIONS_GENERATE 2
  127. #define OPTIONS_COLORS  3
  128. #define OPTIONS_STOP    4
  129. #define OPTIONS_CLOSE    5
  130. #define OPTIONS_COUNT   6
  131.  
  132. /* for the ZOOM Menu ... */
  133. #define ZOOM_WIDTH   222
  134. #define ZOOM_LEFT       (-60)
  135. #define ZOOM_SETCENTER    0
  136. #define ZOOM_SIZEBOX      1
  137. #define ZOOM_SIZEPROP     2
  138. #define ZOOM_ZOOMIN       3
  139. #define ZOOM_ZOOMIN10     4
  140. #define ZOOM_ZOOMOUT2     5
  141. #define ZOOM_ZOOMOUT10    6
  142. #define ZOOM_COUNT        7
  143.  
  144.  
  145. /* === the definitions for the ColorWindow ================================ */
  146. #define COLOR_KNOB_BODY        0x1111
  147.  
  148. #define COLORWINDOW_WIDTH    208
  149. #define COLORWINDOW_HEIGHT    91
  150.  
  151. #define DEFAULT_WINDOW_LEFT    (320 - COLORWINDOW_WIDTH)
  152. #define DEFAULT_WINDOW_TOP    (200 - COLORWINDOW_HEIGHT)
  153.  
  154. #define CHARACTER_WIDTH        8
  155. #define CHARACTER_HEIGHT    8
  156.  
  157. #define COLOR_BOX_LEFT        7
  158. #define COLOR_BOX_TOP        6
  159. #define COLOR_BOX_RIGHT        (COLOR_BOX_LEFT + 15)
  160. #define COLOR_BOX_BOTTOM    (COLOR_BOX_TOP + 29)
  161. #define COLOR_COLOR_TOP        45
  162. #define COLOR_PROP_LEFT        38
  163. #define COLOR_PROP_TOP        4
  164. #define COLOR_PROP_WIDTH    165
  165. #define COLOR_PROP_HEIGHT    10
  166. #define COLOR_CLUSTER_LEFT    141
  167. #define COLOR_CLUSTER_TOP    41
  168. #define COLOR_CLUSTER_WIDTH    (CHARACTER_WIDTH * 6 + 4)
  169. #define COLOR_CLUSTER_HEIGHT    9
  170. #define COLOR_HSL_TOP        (COLOR_BOX_TOP - 2)
  171. #define COLOR_HSL_LEFT        (COLOR_BOX_RIGHT + 3)
  172.  
  173. /* GREEN and RED are out of order.  Do you wonder why?  Some day I'll 
  174.  * tell you.  =RJ=
  175.  */
  176. #define COLOR_COPY        32
  177. #define COLOR_RANGE        33
  178. #define COLOR_OK        34
  179. #define COLOR_CANCEL        35
  180. #define COLOR_GREEN        36
  181. #define COLOR_RED        37
  182. #define COLOR_BLUE        38
  183. #define COLOR_HSL_RGB        39
  184. #define COLOR_GADGETS_COUNT    40
  185.  
  186.  
  187.  
  188. /* === Our Definitions for the IFF Format ================================= */
  189.  
  190. struct    BitMapHeader
  191. {
  192.     USHORT    w;
  193.     USHORT    h;
  194.     SHORT    x, y;
  195.     UBYTE    nPlanes, masking, compression, pad1;
  196.     USHORT    TransparentColor;
  197.     UBYTE    xAspect, yAspect;
  198.     SHORT    PageWidth, PageHeight;
  199. };
  200.  
  201. struct    PaintingHeader
  202. {
  203.     LONG    IFFID, FileLength, ILBMID, BMHDID, BitMapSize;
  204.     struct    BitMapHeader BitMapHeader;
  205.     LONG    CMAP, CMAPlength;
  206. };
  207.  
  208. /* the MakeID macro is defined in iff.h */
  209. #define ILBM                    MakeID('I','L','B','M')
  210. #define BMHD                    MakeID('B','M','H','D')
  211. #define BODY                    MakeID('B','O','D','Y')
  212. #define CMAP                    MakeID('C','M','A','P')
  213. #define CAMG                    MakeID('C','A','M','G')
  214.  
  215. /* ======================================================================== */
  216.  
  217. /* This constant is for Intuition V1.1.  If you are getting "redefinition"
  218.  * warnings when you compile, it's because of this redeclaration.  
  219.  * Is harmless, and when we all get to V1.1 then we all can delete this.
  220.  */
  221. #define INTUITICKS 0x00400000
  222.  
  223.  
  224.